<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

<title>class Object - Rails Application Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
</script>

<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>


<body id="top" class="class">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="./index.html">Home</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>lib/solr.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    <nav id="parent-class-section" class="section">
  <h3 class="section-header">Parent</h3>
  
  <p class="link">BasicObject
  
</nav>

    
    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-i-sru2solr">#sru2solr</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="./MarcTools.html">MarcTools</a>
  
    <li><a href="./MarcTools/MarcConverter.html">MarcTools::MarcConverter</a>
  
    <li><a href="./ApplicationController.html">ApplicationController</a>
  
    <li><a href="./ApplicationHelper.html">ApplicationHelper</a>
  
    <li><a href="./CzController.html">CzController</a>
  
    <li><a href="./MarcconverterController.html">MarcconverterController</a>
  
    <li><a href="./Object.html">Object</a>
  
    <li><a href="./OracleController.html">OracleController</a>
  
    <li><a href="./PersonController.html">PersonController</a>
  
    <li><a href="./PersonHelper.html">PersonHelper</a>
  
    <li><a href="./RsqvHelper.html">RsqvHelper</a>
  
    <li><a href="./RsqvpreviewController.html">RsqvpreviewController</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="class">class Object</h1>

  <div id="description" class="description">
    
  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    <!-- Methods -->
    
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-sru2solr" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">sru2solr</span><span
            class="method-args">(text)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="sru2solr-source">
            <pre><span class="ruby-comment"># File lib/solr.rb, line 3</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sru2solr</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-identifier">res</span>=[]
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">'='</span>)
    <span class="ruby-identifier">res</span><span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>).<span class="ruby-identifier">size</span><span class="ruby-operator">==</span><span class="ruby-value">2</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-string">'*'</span>)
    <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':'</span><span class="ruby-operator">+</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>]
<span class="ruby-keyword">else</span>
<span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':&quot;'</span><span class="ruby-operator">+</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>]<span class="ruby-operator">+</span><span class="ruby-string">'&quot;'</span>
<span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">res</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':'</span>
    <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot; and &quot;</span>)
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'and'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-string">'*'</span>)
        <span class="ruby-identifier">res</span> <span class="ruby-string">&quot;      else
        res &lt;&lt;'&quot;'+ v.split('and')[0].strip+'&quot;'
end
        res &lt;&lt; &quot;AND&quot;
        res&lt;&lt;v.split('and')[1]+':'
      else
        if v.include?('*')
          res &lt;&lt; v
        else
          res &lt;&lt; '&quot;'+v+'&quot;'
        end
      end
    }
  end
  res.join(' ')
end

p sru2solr(a)
&quot;</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'and'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">strip</span>
</pre>
          </div><!-- sru2solr-source -->
          
        </div>

        

        
      </div><!-- sru2solr-method -->

    
    </section><!-- public-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

